function login() {
	var errorMsg = $("#error_message");
	var account = $("#account").val();
	var password = $("#password").val();

	if (account.length == 0) {
		errorMsg.html("用户名或邮箱不能为空");
		return;
	}
	if (password.length == 0) {
		errorMsg.html("密码不能为空");
		return;
	}
	if (password.length < 6 || password.length > 11) {
		errorMsg.html("密码长度应为6到11个字符");
		return;
	}

	$.ajax({
		type : 'POST',
		url : ctx + '/member/login.do',
		data : {
			account : account,
			password : password
		},
		dataType : 'json',
		timeout : 30000,
		context : $('body'),
		success : function(data) {
			if (data.code == "ok") {
				window.location.href = decodeURIComponent(returnUrl);
			} else {
				errorMsg.html(data.msg);
			}
		},
		error : function(xhr, type) {
			errorMsg.html('提交失败!');
		}
	});
}

